-- GENERATED SPELL FOR [Crystalcore Sentinel] --


function spell0_20041(pUnit, Event) --@Charged Arcane Explosion,Self--
pUnit:FullCastSpellOnTarget(37106,pUnit)
pUnit:RegisterEvent('Sorts_20041', 3700, 1)
end

function spell1_20041(pUnit, Event) --@Overcharge,n/a--
pUnit:FullCastSpellOnTarget(37104,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_20041', 2000, 1)
end

function spell2_20041(pUnit, Event) --@Powered Down,Self--
pUnit:FullCastSpellOnTarget(34937,pUnit)
pUnit:RegisterEvent('Sorts_20041', 628, 1)
end

function Sorts_20041(pUnit, Event)
local choix_sorts_20041 = math.random(0, 2)
if choix_sorts_20041 == 0 then
pUnit:RegisterEvent('spell0_20041', 1, 1)
end
if choix_sorts_20041 == 1 then
pUnit:RegisterEvent('spell1_20041', 1, 1)
end
if choix_sorts_20041 == 2 then
pUnit:RegisterEvent('spell2_20041', 1, 1)
end
end

function mob20041_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_20041', math.random(1500, 3000), 1)
end

function mob20041_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob20041_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob20041_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(20041, 1, 'mob20041_Action')
RegisterUnitEvent(20041, 2, 'mob20041_Leave')
RegisterUnitEvent(20041, 3, 'mob20041_Kill')
RegisterUnitEvent(20041, 4, 'mob20041_Die')
